using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using AutoGear.BLL;

public partial class admin_shipping_edit : SiteAdminBasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            LoadCMSContent();
        }
    }
    private void LoadCMSContent()
    {
        CMS cmsShipping = CMS.GetCMS(CMSType.Shipping);
        fckContent.Value = Server.HtmlDecode(cmsShipping.CMSContent);
    }

    protected void Create_Click(object sender, ImageClickEventArgs e)
    {
        try
        {

            CMS cmsShipping = CMS.GetCMS(CMSType.Shipping);
            cmsShipping.CMSType = CMSType.ShippingPolicy;
            cmsShipping.CMSContent = fckContent.Value;
            if (cmsShipping.CMSId == 0)
            {
                cmsShipping.Create();
            }
            else
            {
                cmsShipping.Update();
            }
            uccResponseMessage.SetSuccessMessage("Shipping updated");
        }
        catch
        {
            uccResponseMessage.SetFailMessage("Failed");
        }
    }
}
